package utils;

import java.io.File;
import java.util.TreeMap;

public class IconManager {

	private static final String ICON_SUBFOLDER = "icons" ;
	
	public enum IconType {
		CONNECT,
		CHANGE_LOGIN,
		DISCONNECT,
		APROPOS,
		CONFIG,
		MENU_CLOSE_TAB,
		DIALOG,
		FILE,
		QUIT,
		CLOSE_TAB,
		CLOSE_TAB_OVER
	}
	
	private static final TreeMap <IconType, String> ICONS = new TreeMap <IconType, String> () ;
	
	static {
		ICONS.put(IconType.CONNECT, "connect.png") ;
		ICONS.put(IconType.CHANGE_LOGIN, "change_username.png") ;
		ICONS.put(IconType.DISCONNECT, "disconnect.png") ;
		ICONS.put(IconType.APROPOS, "apropos.png") ;
		ICONS.put(IconType.MENU_CLOSE_TAB, "menu_close_tab.gif") ;
		ICONS.put(IconType.CONFIG, "config.png") ;
		ICONS.put(IconType.DIALOG, "dialog.png") ;
		ICONS.put(IconType.FILE, "file.gif") ;
		ICONS.put(IconType.QUIT, "quit.png") ;
		ICONS.put(IconType.CLOSE_TAB, "close_tab.png") ;
		ICONS.put(IconType.CLOSE_TAB_OVER, "close_tab_over.png") ;
	}
	
	
	/**
	 * @return The icon folder path
	 */
	public static String getIconFolder () {
		return Configuration.getImageFolder() + File.separator + ICON_SUBFOLDER ;
	}
	
	/**
	 * Get the full path for the specified icon.
	 * 
	 * @param it
	 * @return
	 */
	public static String getIcon (IconType it) {
		return getIconFolder() + File.separator + ICONS.get(it) ;
	}
	
}
